.class public final Lcom/baidu/AdView;
.super Landroid/widget/RelativeLayout;


# static fields
.field private static a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/content/Context;",
            ">;>;"
        }
    .end annotation
.end field


# instance fields
.field private b:Landroid/os/Handler;

.field private c:Lcom/baidu/l;

.field private d:Z

.field private e:Ljava/util/Timer;

.field private f:Ljava/lang/String;

.field private g:Lcom/baidu/t;

.field private h:I

.field private i:I

.field private j:I

.field private final k:I

.field private final l:Lcom/baidu/s;

.field private m:Lcom/baidu/AdViewListener;

.field private n:I

.field private o:I

.field private p:Z

.field private q:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    sput-object v0, Lcom/baidu/AdView;->a:Ljava/util/List;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    sget-object v0, Lcom/baidu/AdType;->TEXT:Lcom/baidu/AdType;

    invoke-direct {p0, p1, v0}, Lcom/baidu/AdView;-><init>(Landroid/content/Context;Lcom/baidu/AdType;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 2

    const/4 v0, 0x0

    sget-object v1, Lcom/baidu/AdType;->TEXT:Lcom/baidu/AdType;

    invoke-direct {p0, p1, p2, v0, v1}, Lcom/baidu/AdView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;ILcom/baidu/AdType;)V

    return-void
.end method

.method constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;ILcom/baidu/AdType;)V
    .locals 3

    const/4 v1, 0x0

    invoke-direct {p0, p1, p2, p3}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/baidu/AdView;->b:Landroid/os/Handler;

    const v0, -0xaaaaab

    iput v0, p0, Lcom/baidu/AdView;->h:I

    const/16 v0, 0xff

    iput v0, p0, Lcom/baidu/AdView;->i:I

    const/4 v0, -0x1

    iput v0, p0, Lcom/baidu/AdView;->j:I

    const/16 v0, 0x1e

    iput v0, p0, Lcom/baidu/AdView;->k:I

    new-instance v0, Lcom/baidu/x;

    invoke-direct {v0, p0}, Lcom/baidu/x;-><init>(Lcom/baidu/AdView;)V

    iput-object v0, p0, Lcom/baidu/AdView;->l:Lcom/baidu/s;

    new-instance v0, Lcom/baidu/y;

    invoke-direct {v0, p0}, Lcom/baidu/y;-><init>(Lcom/baidu/AdView;)V

    iput-object v0, p0, Lcom/baidu/AdView;->m:Lcom/baidu/AdViewListener;

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/baidu/AdView;->p:Z

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->setFocusable(Z)V

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->setClickable(Z)V

    invoke-direct {p0, p1}, Lcom/baidu/AdView;->a(Landroid/content/Context;)V

    invoke-static {p1}, Lcom/baidu/c;->a(Landroid/content/Context;)V

    if-eqz p2, :cond_0

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "http://schemas.android.com/apk/res/"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "textColor"

    invoke-interface {p2, v0, v1}, Landroid/util/AttributeSet;->getAttributeValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->setTextColor(I)V

    const-string v1, "backgroundColor"

    invoke-interface {p2, v0, v1}, Landroid/util/AttributeSet;->getAttributeValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->setBackgroundColor(I)V

    const-string v1, "backgroundTransparent"

    iget v2, p0, Lcom/baidu/AdView;->i:I

    invoke-interface {p2, v0, v1, v2}, Landroid/util/AttributeSet;->getAttributeIntValue(Ljava/lang/String;Ljava/lang/String;I)I

    move-result v1

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->setBackgroundTransparent(I)V

    const-string v1, "adType"

    sget-object v2, Lcom/baidu/AdType;->TEXT:Lcom/baidu/AdType;

    invoke-virtual {v2}, Lcom/baidu/AdType;->getValue()I

    move-result v2

    invoke-interface {p2, v0, v1, v2}, Landroid/util/AttributeSet;->getAttributeUnsignedIntValue(Ljava/lang/String;Ljava/lang/String;I)I

    move-result v0

    invoke-static {v0}, Lcom/baidu/AdType;->parse(I)Lcom/baidu/AdType;

    move-result-object v0

    :goto_0
    invoke-virtual {v0}, Lcom/baidu/AdType;->a()Lcom/baidu/t;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/baidu/AdView;->a(Lcom/baidu/t;)V

    invoke-direct {p0}, Lcom/baidu/AdView;->b()V

    return-void

    :cond_0
    move-object v0, p4

    goto :goto_0
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/baidu/AdType;)V
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-direct {p0, p1, v0, v1, p2}, Lcom/baidu/AdView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;ILcom/baidu/AdType;)V

    return-void
.end method

.method static synthetic a(Lcom/baidu/AdView;)Lcom/baidu/AdViewListener;
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->c()Lcom/baidu/AdViewListener;

    move-result-object v0

    return-object v0
.end method

.method private a(IILcom/baidu/Ad;)Lcom/baidu/ag;
    .locals 10

    const/16 v8, 0xc8

    const/16 v7, 0x1e

    const/4 v5, -0x1

    const/4 v4, -0x2

    const v6, 0x3e19999a

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/baidu/r;->i(Landroid/content/Context;)I

    move-result v0

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/baidu/r;->h(Landroid/content/Context;)I

    move-result v1

    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v2

    sget-object v3, Lcom/baidu/t;->a:Lcom/baidu/t;

    if-eq v2, v3, :cond_0

    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v2

    sget-object v3, Lcom/baidu/t;->c:Lcom/baidu/t;

    if-ne v2, v3, :cond_4

    :cond_0
    if-eqz p1, :cond_1

    if-ne p1, v4, :cond_9

    :cond_1
    move v2, v0

    :goto_0
    if-ge v2, v8, :cond_2

    if-eq v2, v5, :cond_2

    move v2, v8

    :cond_2
    if-eqz p2, :cond_3

    if-ne p2, v4, :cond_8

    :cond_3
    invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I

    move-result v0

    int-to-float v0, v0

    mul-float/2addr v0, v6

    float-to-int v0, v0

    :goto_1
    if-ge v0, v7, :cond_7

    if-eq v0, v5, :cond_7

    move v0, v7

    move v1, v2

    :goto_2
    new-instance v2, Lcom/baidu/ag;

    invoke-direct {v2, v1, v0}, Lcom/baidu/ag;-><init>(II)V

    return-object v2

    :cond_4
    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v2

    sget-object v3, Lcom/baidu/t;->b:Lcom/baidu/t;

    if-ne v2, v3, :cond_6

    invoke-virtual {p3}, Lcom/baidu/Ad;->c()Landroid/graphics/Bitmap;

    move-result-object v2

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v2

    int-to-double v2, v2

    invoke-virtual {p3}, Lcom/baidu/Ad;->c()Landroid/graphics/Bitmap;

    move-result-object v4

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v4

    int-to-double v4, v4

    div-double/2addr v2, v4

    invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I

    move-result v1

    int-to-double v4, v1

    mul-double v1, v2, v4

    double-to-int v1, v1

    if-ne v1, v0, :cond_5

    int-to-float v1, v0

    mul-float/2addr v1, v6

    float-to-int v1, v1

    move v9, v1

    move v1, v0

    move v0, v9

    goto :goto_2

    :cond_5
    move v9, v1

    move v1, v0

    move v0, v9

    goto :goto_2

    :cond_6
    move v0, p2

    move v1, p1

    goto :goto_2

    :cond_7
    move v1, v2

    goto :goto_2

    :cond_8
    move v0, p2

    goto :goto_1

    :cond_9
    move v2, p1

    goto :goto_0
.end method

.method static synthetic a(Lcom/baidu/AdView;IILcom/baidu/Ad;)Lcom/baidu/ag;
    .locals 1

    invoke-direct {p0, p1, p2, p3}, Lcom/baidu/AdView;->a(IILcom/baidu/Ad;)Lcom/baidu/ag;

    move-result-object v0

    return-object v0
.end method

.method static synthetic a(Lcom/baidu/AdView;Lcom/baidu/l;)Lcom/baidu/l;
    .locals 0

    iput-object p1, p0, Lcom/baidu/AdView;->c:Lcom/baidu/l;

    return-object p1
.end method

.method private a(Landroid/content/Context;)V
    .locals 3

    const/4 v2, 0x0

    invoke-static {p1}, Lcom/baidu/r;->m(Landroid/content/Context;)V

    move v0, v2

    :goto_0
    sget-object v1, Lcom/baidu/AdView;->a:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_2

    sget-object v1, Lcom/baidu/AdView;->a:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Ljava/lang/ref/WeakReference;

    invoke-virtual {p0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    if-ne v1, p1, :cond_0

    const/4 v0, 0x1

    :goto_1
    if-eqz v0, :cond_1

    const-string v0, "More than one AdView instance in an activity!"

    new-instance v1, Ljava/lang/SecurityException;

    invoke-direct {v1, v0}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v1

    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_1
    sget-object v0, Lcom/baidu/AdView;->a:Ljava/util/List;

    new-instance v1, Ljava/lang/ref/WeakReference;

    invoke-direct {v1, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void

    :cond_2
    move v0, v2

    goto :goto_1
.end method

.method static synthetic a(Lcom/baidu/AdView;Lcom/baidu/t;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/baidu/AdView;->a(Lcom/baidu/t;)V

    return-void
.end method

.method static synthetic a(Lcom/baidu/AdView;Ljava/lang/String;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/baidu/AdView;->a(Ljava/lang/String;)V

    return-void
.end method

.method static synthetic a(Lcom/baidu/AdView;Z)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/baidu/AdView;->d(Z)V

    return-void
.end method

.method private a(Lcom/baidu/t;)V
    .locals 0

    iput-object p1, p0, Lcom/baidu/AdView;->g:Lcom/baidu/t;

    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/baidu/AdView;->f:Ljava/lang/String;

    return-void
.end method

.method private a(Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/baidu/AdView;->p:Z

    return-void
.end method

.method private b()V
    .locals 1

    new-instance v0, Lcom/baidu/z;

    invoke-direct {v0, p0, p0}, Lcom/baidu/z;-><init>(Lcom/baidu/AdView;Lcom/baidu/AdView;)V

    invoke-virtual {v0}, Lcom/baidu/z;->start()V

    return-void
.end method

.method static synthetic b(Lcom/baidu/AdView;)V
    .locals 0

    invoke-direct {p0}, Lcom/baidu/AdView;->f()V

    return-void
.end method

.method private b(Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/baidu/AdView;->q:Z

    return-void
.end method

.method private c()Lcom/baidu/AdViewListener;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->m:Lcom/baidu/AdViewListener;

    return-object v0
.end method

.method static synthetic c(Lcom/baidu/AdView;)Lcom/baidu/t;
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v0

    return-object v0
.end method

.method private c(Z)V
    .locals 6

    const-wide/16 v2, 0x7530

    if-eqz p1, :cond_2

    const-string v0, "Timer Start"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    iget-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    :cond_0
    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    iget-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    new-instance v1, Lcom/baidu/ac;

    invoke-direct {v1, p0}, Lcom/baidu/ac;-><init>(Lcom/baidu/AdView;)V

    move-wide v4, v2

    invoke-virtual/range {v0 .. v5}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;JJ)V

    :cond_1
    :goto_0
    return-void

    :cond_2
    iget-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    if-eqz v0, :cond_1

    const-string v0, "Timer Cancel"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    iget-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/baidu/AdView;->e:Ljava/util/Timer;

    goto :goto_0
.end method

.method static synthetic d(Lcom/baidu/AdView;)Lcom/baidu/l;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->c:Lcom/baidu/l;

    return-object v0
.end method

.method private d()Lcom/baidu/t;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->g:Lcom/baidu/t;

    return-object v0
.end method

.method private d(Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/baidu/AdView;->d:Z

    return-void
.end method

.method private e()I
    .locals 1

    const/16 v0, 0x1e

    return v0
.end method

.method static synthetic e(Lcom/baidu/AdView;)Landroid/os/Handler;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->b:Landroid/os/Handler;

    return-object v0
.end method

.method private f()V
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/baidu/AdView;->getVisibility()I

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "AdView.refresh"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/AdView;->g()V

    invoke-direct {p0}, Lcom/baidu/AdView;->h()V

    goto :goto_0
.end method

.method static synthetic f(Lcom/baidu/AdView;)V
    .locals 0

    invoke-direct {p0}, Lcom/baidu/AdView;->j()V

    return-void
.end method

.method private g()V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    invoke-direct {p0, v1}, Lcom/baidu/AdView;->c(Z)V

    invoke-direct {p0, v1}, Lcom/baidu/AdView;->d(Z)V

    goto :goto_0
.end method

.method static synthetic g(Lcom/baidu/AdView;)V
    .locals 0

    invoke-direct {p0}, Lcom/baidu/AdView;->m()V

    return-void
.end method

.method static synthetic h(Lcom/baidu/AdView;)Ljava/lang/String;
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->n()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private h()V
    .locals 3

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/baidu/AdView;->getVisibility()I

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "AdView.start"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "AdSrc:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/AdView;->k()V

    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/baidu/AdView;->c(Z)V

    goto :goto_0
.end method

.method static synthetic i(Lcom/baidu/AdView;)Lcom/baidu/s;
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->o()Lcom/baidu/s;

    move-result-object v0

    return-object v0
.end method

.method private i()Z
    .locals 10

    const/4 v9, 0x2

    const/4 v8, 0x0

    const/4 v7, 0x1

    const-string v1, "AdView.hasSpam =>"

    invoke-static {v1}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    invoke-static {}, Lcom/baidu/c;->a()Lcom/baidu/c;

    move-result-object v1

    invoke-virtual {v1}, Lcom/baidu/c;->f()Z

    move-result v1

    if-eqz v1, :cond_0

    const-string v1, "AdView"

    const-string v2, "\u6ca1\u6709\u53ef\u5c55\u793a\u7684\u63a8\u5e7f (No ad to show)"

    invoke-static {v1, v2}, Lcom/baidu/bk;->c(Ljava/lang/String;Ljava/lang/String;)I

    move v1, v7

    :goto_0
    return v1

    :cond_0
    invoke-static {}, Lcom/baidu/c;->a()Lcom/baidu/c;

    move-result-object v1

    invoke-virtual {v1}, Lcom/baidu/c;->e()Z

    move-result v1

    if-eqz v1, :cond_1

    const-string v1, "AdView"

    const-string v2, "App\u5df2\u88ab\u6401\u7f6e (App is hanged up)"

    invoke-static {v1, v2}, Lcom/baidu/bk;->c(Ljava/lang/String;Ljava/lang/String;)I

    move v1, v7

    goto :goto_0

    :cond_1
    invoke-virtual {p0}, Lcom/baidu/AdView;->getParent()Landroid/view/ViewParent;

    move-result-object v1

    move-object v2, v1

    :goto_1
    if-eqz v2, :cond_3

    instance-of v1, v2, Landroid/view/View;

    if-eqz v1, :cond_2

    move-object v0, v2

    check-cast v0, Landroid/view/View;

    move-object v1, v0

    invoke-virtual {v1}, Landroid/view/View;->getVisibility()I

    move-result v1

    if-eqz v1, :cond_2

    const-string v1, "AdView"

    const-string v2, "AdView\u7684\u4e00\u4e2a\u7956\u5148\u63a7\u4ef6\u4e0d\u4e3a View.VISIBLE (One of AdView\'s ancestor is not View.VISIBLE)"

    invoke-static {v1, v2}, Lcom/baidu/bk;->c(Ljava/lang/String;Ljava/lang/String;)I

    move v1, v7

    goto :goto_0

    :cond_2
    invoke-interface {v2}, Landroid/view/ViewParent;->getParent()Landroid/view/ViewParent;

    move-result-object v1

    move-object v2, v1

    goto :goto_1

    :cond_3
    new-array v1, v9, [I

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->getLocationOnScreen([I)V

    new-instance v2, Landroid/graphics/Rect;

    aget v3, v1, v8

    aget v4, v1, v7

    aget v5, v1, v8

    invoke-virtual {p0}, Lcom/baidu/AdView;->getWidth()I

    move-result v6

    add-int/2addr v5, v6

    aget v1, v1, v7

    invoke-virtual {p0}, Lcom/baidu/AdView;->getHeight()I

    move-result v6

    add-int/2addr v1, v6

    invoke-direct {v2, v3, v4, v5, v1}, Landroid/graphics/Rect;-><init>(IIII)V

    const-string v1, "AdView thisBox"

    invoke-virtual {v2}, Landroid/graphics/Rect;->toShortString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v3}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v1

    instance-of v1, v1, Landroid/app/Activity;

    if-eqz v1, :cond_6

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v1

    check-cast v1, Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v1

    const v3, 0x1020002

    invoke-virtual {v1, v3}, Landroid/view/Window;->findViewById(I)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/View;->getTop()I

    move-result v1

    new-instance v3, Landroid/graphics/Rect;

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v4

    invoke-static {v4}, Lcom/baidu/r;->i(Landroid/content/Context;)I

    move-result v4

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v5}, Lcom/baidu/r;->h(Landroid/content/Context;)I

    move-result v5

    invoke-direct {v3, v8, v1, v4, v5}, Landroid/graphics/Rect;-><init>(IIII)V

    const-string v1, "AdView availBox"

    invoke-virtual {v3}, Landroid/graphics/Rect;->toShortString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v1, v4}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {v3, v2}, Landroid/graphics/Rect;->contains(Landroid/graphics/Rect;)Z

    move-result v1

    if-nez v1, :cond_5

    const-string v1, "AdView"

    const-string v2, "\u63a8\u5e7f\u8fb9\u754c\u4e0d\u5b8c\u5168\u5728\u7a97\u53e3\u5185 (Ad is not in window)"

    invoke-static {v1, v2}, Lcom/baidu/bk;->c(Ljava/lang/String;Ljava/lang/String;)I

    invoke-direct {p0, v8}, Lcom/baidu/AdView;->a(Z)V

    iget v1, p0, Lcom/baidu/AdView;->o:I

    add-int/lit8 v2, v1, 0x1

    iput v2, p0, Lcom/baidu/AdView;->o:I

    if-ge v1, v9, :cond_4

    :cond_4
    move v1, v7

    goto/16 :goto_0

    :cond_5
    invoke-direct {p0, v7}, Lcom/baidu/AdView;->a(Z)V

    :cond_6
    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v1

    instance-of v1, v1, Landroid/app/Activity;

    if-eqz v1, :cond_7

    :cond_7
    move v1, v8

    goto/16 :goto_0
.end method

.method static synthetic j(Lcom/baidu/AdView;)Lcom/baidu/l;
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    return-object v0
.end method

.method private j()V
    .locals 3

    const/4 v2, 0x1

    const/4 v1, 0x0

    iget v0, p0, Lcom/baidu/AdView;->i:I

    invoke-virtual {p0, v0}, Lcom/baidu/AdView;->setBackgroundTransparent(I)V

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/baidu/AdView;->a()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/baidu/l;->setClickable(Z)V

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/baidu/l;->setFocusable(Z)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0, v2}, Lcom/baidu/l;->setClickable(Z)V

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0, v2}, Lcom/baidu/l;->setFocusable(Z)V

    goto :goto_0
.end method

.method static synthetic k(Lcom/baidu/AdView;)I
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->e()I

    move-result v0

    return v0
.end method

.method private k()V
    .locals 2

    const-string v0, "requestFreshAd"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    :try_start_0
    invoke-direct {p0}, Lcom/baidu/AdView;->i()Z

    move-result v0

    invoke-direct {p0, v0}, Lcom/baidu/AdView;->b(Z)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    iget-boolean v0, p0, Lcom/baidu/AdView;->d:Z

    if-eqz v0, :cond_0

    const-string v0, "Ignoring requestFreshAd() because we are already getting a fresh ad."

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    :goto_1
    return-void

    :catch_0
    move-exception v0

    const-string v1, "requestFreshAd"

    invoke-static {v1, v0}, Lcom/baidu/bk;->a(Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0

    :cond_0
    invoke-virtual {p0}, Lcom/baidu/AdView;->getVisibility()I

    move-result v0

    if-eqz v0, :cond_1

    invoke-direct {p0}, Lcom/baidu/AdView;->g()V

    goto :goto_1

    :cond_1
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/baidu/AdView;->d(Z)V

    iget-object v0, p0, Lcom/baidu/AdView;->b:Landroid/os/Handler;

    new-instance v1, Lcom/baidu/ab;

    invoke-direct {v1, p0, p0}, Lcom/baidu/ab;-><init>(Lcom/baidu/AdView;Lcom/baidu/AdView;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    goto :goto_1
.end method

.method private l()Lcom/baidu/l;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->c:Lcom/baidu/l;

    return-object v0
.end method

.method static synthetic l(Lcom/baidu/AdView;)V
    .locals 0

    invoke-direct {p0}, Lcom/baidu/AdView;->g()V

    return-void
.end method

.method private m()V
    .locals 3

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0}, Lcom/baidu/l;->d()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0}, Lcom/baidu/l;->h()Lcom/baidu/Ad;

    move-result-object v0

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v1

    invoke-virtual {v1}, Lcom/baidu/l;->c()Ljava/util/Map;

    move-result-object v1

    new-instance v2, Lcom/baidu/ae;

    invoke-direct {v2, p0, v0, v1}, Lcom/baidu/ae;-><init>(Lcom/baidu/AdView;Lcom/baidu/Ad;Ljava/util/Map;)V

    invoke-virtual {v2}, Lcom/baidu/ae;->start()V

    :cond_0
    return-void
.end method

.method static synthetic m(Lcom/baidu/AdView;)V
    .locals 0

    invoke-direct {p0}, Lcom/baidu/AdView;->k()V

    return-void
.end method

.method private n()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->f:Ljava/lang/String;

    return-object v0
.end method

.method private o()Lcom/baidu/s;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->l:Lcom/baidu/s;

    return-object v0
.end method

.method private p()Z
    .locals 1

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method a()Z
    .locals 1

    iget-boolean v0, p0, Lcom/baidu/AdView;->q:Z

    return v0
.end method

.method public getAdType()Lcom/baidu/AdType;
    .locals 1

    iget-object v0, p0, Lcom/baidu/AdView;->g:Lcom/baidu/t;

    invoke-virtual {v0}, Lcom/baidu/t;->c()Lcom/baidu/AdType;

    move-result-object v0

    return-object v0
.end method

.method public getBackgroundColor()I
    .locals 1

    iget v0, p0, Lcom/baidu/AdView;->h:I

    return v0
.end method

.method public getBackgroundTransparent()I
    .locals 1

    iget v0, p0, Lcom/baidu/AdView;->i:I

    return v0
.end method

.method public getTextColor()I
    .locals 1

    iget v0, p0, Lcom/baidu/AdView;->j:I

    return v0
.end method

.method public getVisibility()I
    .locals 1

    iget v0, p0, Lcom/baidu/AdView;->n:I

    return v0
.end method

.method public isInWindow()Z
    .locals 1

    iget-boolean v0, p0, Lcom/baidu/AdView;->p:Z

    return v0
.end method

.method protected onDetachedFromWindow()V
    .locals 3

    const-string v0, "AdView.onDetachedFromWindow"

    invoke-static {v0}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    invoke-direct {p0}, Lcom/baidu/AdView;->m()V

    invoke-static {}, Lcom/baidu/c;->a()Lcom/baidu/c;

    move-result-object v0

    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v1

    invoke-direct {p0}, Lcom/baidu/AdView;->e()I

    move-result v2

    invoke-virtual {v0, v1, v2}, Lcom/baidu/c;->a(Lcom/baidu/t;I)V

    invoke-super {p0}, Landroid/widget/RelativeLayout;->onDetachedFromWindow()V

    goto :goto_0
.end method

.method protected onWindowVisibilityChanged(I)V
    .locals 6

    const/4 v5, 0x1

    iput p1, p0, Lcom/baidu/AdView;->n:I

    invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onWindowVisibilityChanged(I)V

    const-string v0, "AdView.onWindowVisibilityChanged"

    const-string v1, "visibility: %s dim(%d, %d)"

    const/4 v2, 0x3

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {p0}, Lcom/baidu/AdView;->getWidth()I

    move-result v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v5

    const/4 v3, 0x2

    invoke-virtual {p0}, Lcom/baidu/AdView;->getHeight()I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    if-nez p1, :cond_2

    invoke-virtual {p0}, Lcom/baidu/AdView;->getWidth()I

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/baidu/AdView;->getHeight()I

    move-result v0

    if-eqz v0, :cond_0

    invoke-direct {p0, v5}, Lcom/baidu/AdView;->c(Z)V

    goto :goto_0

    :cond_2
    invoke-direct {p0}, Lcom/baidu/AdView;->g()V

    invoke-static {}, Lcom/baidu/c;->a()Lcom/baidu/c;

    move-result-object v0

    invoke-direct {p0}, Lcom/baidu/AdView;->d()Lcom/baidu/t;

    move-result-object v1

    invoke-direct {p0}, Lcom/baidu/AdView;->e()I

    move-result v2

    invoke-virtual {v0, v1, v2}, Lcom/baidu/c;->a(Lcom/baidu/t;I)V

    goto :goto_0
.end method

.method public refresh()V
    .locals 2

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/baidu/r;->c(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    const-string v0, "AdView.refresh"

    const-string v1, "Not in TestMode or not inited"

    invoke-static {v0, v1}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    :goto_0
    return-void

    :cond_1
    invoke-direct {p0}, Lcom/baidu/AdView;->f()V

    goto :goto_0
.end method

.method public setAlpha(F)V
    .locals 2

    const-string v0, "AdView.setAlpha"

    const-string v1, "override, do nothing"

    invoke-static {v0, v1}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    return-void
.end method

.method public setBackgroundColor(I)V
    .locals 1

    iput p1, p0, Lcom/baidu/AdView;->h:I

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/baidu/l;->setBackgroundColor(I)V

    :cond_0
    return-void
.end method

.method public setBackgroundTransparent(I)V
    .locals 3

    const/16 v1, 0xff

    const/16 v0, 0x7f

    if-le p1, v1, :cond_3

    move v0, v1

    :cond_0
    :goto_0
    iput v0, p0, Lcom/baidu/AdView;->i:I

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v1

    if-eqz v1, :cond_2

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v1

    invoke-virtual {p0}, Lcom/baidu/AdView;->a()Z

    move-result v2

    if-eqz v2, :cond_1

    const/4 v0, 0x0

    :cond_1
    invoke-virtual {v1, v0}, Lcom/baidu/l;->b(I)V

    :cond_2
    return-void

    :cond_3
    if-lt p1, v0, :cond_0

    move v0, p1

    goto :goto_0
.end method

.method public setListener(Lcom/baidu/AdViewListener;)V
    .locals 0

    iput-object p1, p0, Lcom/baidu/AdView;->m:Lcom/baidu/AdViewListener;

    return-void
.end method

.method public setTextColor(I)V
    .locals 1

    iput p1, p0, Lcom/baidu/AdView;->j:I

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/baidu/AdView;->l()Lcom/baidu/l;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/baidu/l;->a(I)V

    :cond_0
    return-void
.end method

.method public setVisibility(I)V
    .locals 3

    invoke-virtual {p0}, Lcom/baidu/AdView;->getVisibility()I

    move-result v0

    if-ne v0, p1, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iput p1, p0, Lcom/baidu/AdView;->n:I

    invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    const-string v0, "AdView.setVisibility"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "visibility:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    invoke-direct {p0}, Lcom/baidu/AdView;->p()Z

    move-result v0

    if-eqz v0, :cond_0

    monitor-enter p0

    :try_start_0
    invoke-virtual {p0}, Lcom/baidu/AdView;->getChildCount()I

    move-result v0

    const/4 v1, 0x0

    :goto_1
    if-ge v1, v0, :cond_2

    invoke-virtual {p0, v1}, Lcom/baidu/AdView;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2, p1}, Landroid/view/View;->setVisibility(I)V

    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    :cond_2
    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz p1, :cond_3

    invoke-direct {p0}, Lcom/baidu/AdView;->m()V

    :cond_3
    invoke-virtual {p0, p1}, Lcom/baidu/AdView;->onWindowVisibilityChanged(I)V

    goto :goto_0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method
